I want to apply this filter with show ancestors and descendants in all modules/folders ((CSCI Test ID is not empty) AND (Requirement == True)) and set a Temp attribute to "X" I have over 50 modules and don't want to go through each module with the view and set it manually. Is this possible? |
Re: Setting an Attribute
Huh?
Skip skpQualify = create // KEY and DATA both "Object" that qualifies
Skip skpMarks = create // KEY and DATA both "Object" that needs to be marked.
void MarkChildren(Object obj)
{ // RECURSIVELY mark this and all children objects
if (null obj or isDeleted(obj)) return
put(skpMarks, obj, obj)
for oChild in obj do
{ MarkChildren(oChild) // ** RECURSION HERE
}
} // end MarkChildren()
// above would be global code. Following would be inside the edited module code:
for obj in entire mod do
{ if (!isDeleted(obj) and object qualifies) put(skpQualify, obj, obj)
}
for obj in skpQualify do
{ put(skpMarks, obj, obj)
// mark parents:
oParent = parent(obj)
while(!null oParent)
{ put(skpMarks, oParent, oParent)
oParent = parent(oParent)
}
// mark children
MarkChildren(obj)
}
// now mark:
for obj in entire mod do
{ if (find(skpMarks, obj)) //
then obj."Temp" == "X"
else obj."Temp" == ""
}
delete(skpMarks)
delete(skpQualifies)
save and close mod
|
Re: Setting an Attribute llandale - Fri Aug 05 13:34:41 EDT 2011
Huh?
Skip skpQualify = create // KEY and DATA both "Object" that qualifies
Skip skpMarks = create // KEY and DATA both "Object" that needs to be marked.
void MarkChildren(Object obj)
{ // RECURSIVELY mark this and all children objects
if (null obj or isDeleted(obj)) return
put(skpMarks, obj, obj)
for oChild in obj do
{ MarkChildren(oChild) // ** RECURSION HERE
}
} // end MarkChildren()
// above would be global code. Following would be inside the edited module code:
for obj in entire mod do
{ if (!isDeleted(obj) and object qualifies) put(skpQualify, obj, obj)
}
for obj in skpQualify do
{ put(skpMarks, obj, obj)
// mark parents:
oParent = parent(obj)
while(!null oParent)
{ put(skpMarks, oParent, oParent)
oParent = parent(oParent)
}
// mark children
MarkChildren(obj)
}
// now mark:
for obj in entire mod do
{ if (find(skpMarks, obj)) //
then obj."Temp" == "X"
else obj."Temp" == ""
}
delete(skpMarks)
delete(skpQualifies)
save and close mod
|
Re: Setting an Attribute vppatel - Mon Aug 08 12:41:52 EDT 2011
|